        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>ContactConstraint class / box2d Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d" data-type="ContactConstraint">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d.html">box2d</a> &rsaquo; <a href="../box2d/ContactConstraint.html">ContactConstraint</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>ContactConstraint</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
class ContactConstraint {
 List&lt;ContactConstraintPoint&gt; points;

 final vec2 localNormal;
 final vec2 localPoint;
 final vec2 normal;

 final mat2 normalMass;
 //TODO(gregbglw): What does K mean? Find out and change the name.
 final mat2 K;

 Body bodyA;
 Body bodyB;

 int type;

 num radius;
 num friction;
 num restitution;
 int pointCount;

 Manifold manifold;

 ContactConstraint() :
   points = new List&lt;ContactConstraintPoint&gt;(Settings.MAX_MANIFOLD_POINTS),
   pointCount = 0,
   manifold = null,
   localNormal = new vec2.zero(),
   localPoint = new vec2.zero(),
   normal = new vec2.zero(),
   normalMass = new mat2.zero(),
   K = new mat2.zero() {
   for (int i = 0; i &lt; Settings.MAX_MANIFOLD_POINTS; i++) {
       points[i] = new ContactConstraintPoint();
   }
 }

 void setFrom(ContactConstraint cp) {
   pointCount = cp.pointCount;
   localNormal.copyFrom(cp.localNormal);
   localPoint.copyFrom(cp.localPoint);
   normal.copyFrom(cp.normal);
   normalMass.copyFrom(cp.normalMass);
   K.copyFrom(cp.K);
   bodyA = cp.bodyA;
   bodyB = cp.bodyB;
   type = cp.type;
   radius = cp.radius;
   friction = cp.friction;
   restitution = cp.restitution;
   manifold = cp.manifold;
   for(int i=0; i&lt;cp.pointCount; i++) {
     points[i].setFrom(cp.points[i]);
   }
 }

 String toString() {
   String result = 'localNormal: "$localNormal", localPoint: "$localPoint" '
       'normal: "$normal", radius: "$radius" friction: "$friction" '
       'restitution: "$restitution", pointCount: "$pointCount"';
   return result;
 }
}
</pre>
</div>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="ContactConstraint">
<button class="show-code">Code</button>
new <strong>ContactConstraint</strong>() <a class="anchor-link" href="#ContactConstraint"
              title="Permalink to ContactConstraint.ContactConstraint">#</a></h4>
<div class="doc">
<pre class="source">
ContactConstraint() :
 points = new List&lt;ContactConstraintPoint&gt;(Settings.MAX_MANIFOLD_POINTS),
 pointCount = 0,
 manifold = null,
 localNormal = new vec2.zero(),
 localPoint = new vec2.zero(),
 normal = new vec2.zero(),
 normalMass = new mat2.zero(),
 K = new mat2.zero() {
 for (int i = 0; i &lt; Settings.MAX_MANIFOLD_POINTS; i++) {
     points[i] = new ContactConstraintPoint();
 }
}
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="bodyA">
<button class="show-code">Code</button>
<a href="../box2d/Body.html">Body</a>         <strong>bodyA</strong> <a class="anchor-link"
            href="#bodyA"
            title="Permalink to ContactConstraint.bodyA">#</a>
        </h4>
        <div class="doc">
<pre class="source">
bodyA
</pre>
</div>
</div>
<div class="field"><h4 id="bodyB">
<button class="show-code">Code</button>
<a href="../box2d/Body.html">Body</a>         <strong>bodyB</strong> <a class="anchor-link"
            href="#bodyB"
            title="Permalink to ContactConstraint.bodyB">#</a>
        </h4>
        <div class="doc">
<pre class="source">
bodyB
</pre>
</div>
</div>
<div class="field"><h4 id="friction">
<button class="show-code">Code</button>
num         <strong>friction</strong> <a class="anchor-link"
            href="#friction"
            title="Permalink to ContactConstraint.friction">#</a>
        </h4>
        <div class="doc">
<pre class="source">
friction
</pre>
</div>
</div>
<div class="field"><h4 id="K">
<button class="show-code">Code</button>
final <a href="../vector_math/mat2.html">mat2</a>         <strong>K</strong> <a class="anchor-link"
            href="#K"
            title="Permalink to ContactConstraint.K">#</a>
        </h4>
        <div class="doc">
<pre class="source">
K
</pre>
</div>
</div>
<div class="field"><h4 id="localNormal">
<button class="show-code">Code</button>
final <a href="../vector_math/vec2.html">vec2</a>         <strong>localNormal</strong> <a class="anchor-link"
            href="#localNormal"
            title="Permalink to ContactConstraint.localNormal">#</a>
        </h4>
        <div class="doc">
<pre class="source">
localNormal
</pre>
</div>
</div>
<div class="field"><h4 id="localPoint">
<button class="show-code">Code</button>
final <a href="../vector_math/vec2.html">vec2</a>         <strong>localPoint</strong> <a class="anchor-link"
            href="#localPoint"
            title="Permalink to ContactConstraint.localPoint">#</a>
        </h4>
        <div class="doc">
<pre class="source">
localPoint
</pre>
</div>
</div>
<div class="field"><h4 id="manifold">
<button class="show-code">Code</button>
<a href="../box2d/Manifold.html">Manifold</a>         <strong>manifold</strong> <a class="anchor-link"
            href="#manifold"
            title="Permalink to ContactConstraint.manifold">#</a>
        </h4>
        <div class="doc">
<pre class="source">
manifold
</pre>
</div>
</div>
<div class="field"><h4 id="normal">
<button class="show-code">Code</button>
final <a href="../vector_math/vec2.html">vec2</a>         <strong>normal</strong> <a class="anchor-link"
            href="#normal"
            title="Permalink to ContactConstraint.normal">#</a>
        </h4>
        <div class="doc">
<pre class="source">
normal
</pre>
</div>
</div>
<div class="field"><h4 id="normalMass">
<button class="show-code">Code</button>
final <a href="../vector_math/mat2.html">mat2</a>         <strong>normalMass</strong> <a class="anchor-link"
            href="#normalMass"
            title="Permalink to ContactConstraint.normalMass">#</a>
        </h4>
        <div class="doc">
<pre class="source">
normalMass
</pre>
</div>
</div>
<div class="field"><h4 id="pointCount">
<button class="show-code">Code</button>
int         <strong>pointCount</strong> <a class="anchor-link"
            href="#pointCount"
            title="Permalink to ContactConstraint.pointCount">#</a>
        </h4>
        <div class="doc">
<pre class="source">
pointCount
</pre>
</div>
</div>
<div class="field"><h4 id="points">
<button class="show-code">Code</button>
List&lt;<a href="../box2d/ContactConstraintPoint.html">ContactConstraintPoint</a>&gt;         <strong>points</strong> <a class="anchor-link"
            href="#points"
            title="Permalink to ContactConstraint.points">#</a>
        </h4>
        <div class="doc">
<pre class="source">
points
</pre>
</div>
</div>
<div class="field"><h4 id="radius">
<button class="show-code">Code</button>
num         <strong>radius</strong> <a class="anchor-link"
            href="#radius"
            title="Permalink to ContactConstraint.radius">#</a>
        </h4>
        <div class="doc">
<pre class="source">
radius
</pre>
</div>
</div>
<div class="field"><h4 id="restitution">
<button class="show-code">Code</button>
num         <strong>restitution</strong> <a class="anchor-link"
            href="#restitution"
            title="Permalink to ContactConstraint.restitution">#</a>
        </h4>
        <div class="doc">
<pre class="source">
restitution
</pre>
</div>
</div>
<div class="field"><h4 id="type">
<button class="show-code">Code</button>
int         <strong>type</strong> <a class="anchor-link"
            href="#type"
            title="Permalink to ContactConstraint.type">#</a>
        </h4>
        <div class="doc">
<pre class="source">
type
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="setFrom">
<button class="show-code">Code</button>
void <strong>setFrom</strong>(<a href="../box2d/ContactConstraint.html">ContactConstraint</a> cp) <a class="anchor-link" href="#setFrom"
              title="Permalink to ContactConstraint.setFrom">#</a></h4>
<div class="doc">
<pre class="source">
void setFrom(ContactConstraint cp) {
 pointCount = cp.pointCount;
 localNormal.copyFrom(cp.localNormal);
 localPoint.copyFrom(cp.localPoint);
 normal.copyFrom(cp.normal);
 normalMass.copyFrom(cp.normalMass);
 K.copyFrom(cp.K);
 bodyA = cp.bodyA;
 bodyB = cp.bodyB;
 type = cp.type;
 radius = cp.radius;
 friction = cp.friction;
 restitution = cp.restitution;
 manifold = cp.manifold;
 for(int i=0; i&lt;cp.pointCount; i++) {
   points[i].setFrom(cp.points[i]);
 }
}
</pre>
</div>
</div>
<div class="method"><h4 id="toString">
<button class="show-code">Code</button>
String <strong>toString</strong>() <a class="anchor-link" href="#toString"
              title="Permalink to ContactConstraint.toString">#</a></h4>
<div class="doc">
<div class="inherited">
<p>Returns a string representation of this object.</p>
<div class="docs-inherited-from">docs inherited from Object </div></div>
<pre class="source">
String toString() {
 String result = 'localNormal: "$localNormal", localPoint: "$localPoint" '
     'normal: "$normal", radius: "$radius" friction: "$friction" '
     'restitution: "$restitution", pointCount: "$pointCount"';
 return result;
}
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
